$border_radius: 5px;

@mixin badge($text, $bcolor, $color) {
  content: $text;
  background-color: $bcolor;
  color: $color;
  opacity: 0.9;
  border-radius: 12px;
  margin: 0 0.5em 0.1em 0;
  padding: 0.2em 0.5em;
  border: 1px solid cadetblue;
  font-size: 12px;
  font-weight: bold;
  vertical-align: middle;
  display: inline-block;
}

@mixin property-badge { @include badge('P', skyblue, aliceblue); }
@mixin method-badge { @include badge('m', mediumseagreen, aliceblue); }
@mixin function-badge { @include badge('F', mediumpurple, aliceblue); }
@mixin meta-badge {
  @include badge('Meta', seagreen, aliceblue);
  font-style: italic;
}

@mixin toc-badge {
  margin-left: -2em;
  font-size: 8px;
  margin-bottom: 0.3em;
}

@mixin code-info($text) {
  content: $text;
  float: right;
  border-bottom-left-radius: 7px;
  border-top-right-radius: 3px;
  background-color: white;
  color: darkslategray;
  padding: 0 0.5em 0 0.5em;
  margin-right: -9.5px;
  margin-top: -9.5px;
  border-left: 1px solid lightgray;
  border-bottom: 1px solid lightgray;
}

body {
  font-size: 16px;
  line-height: 1.8em;
  color: #666;
}

.navbar {
  margin: 0;
  padding: 0;
  background-color: #336699;
  border-radius: 0;
  text-align: center;
  ul.nav {
    display: inline-block;
    padding: 0;
    margin: 0;
  }
  li {
    text-align: center;
    font-size: 0.9em;
    padding: 0;
    margin: 0;
    a {
      color: #cdd;
    }
    a:hover {
      color: white;
      background-color: transparent;
    }
  }
}

.heading-box {
    margin: 0;
    padding-top: 1.5em;
    padding-bottom: 1em;
    background-color: #336699;
    @media (max-width: 669px) {
      h1.title {
        font-size: 2em;
      }
      .lead {
        font-size: 1em;
      }
    }
    @media (min-width: 670px) {
      h1.title {
        font-size: 3em;
      }
      .lead {
        font-size: 1.3em;
      }
    }

    h1.title {
      text-align: center;
      margin-top: 0;
      padding-top: 0;
      margin-bottom: 0.5em;
      font-weight: lighter;
      color: #ddd;
      text-shadow: 1px 1px 2px #666;
    }
    .lead {
      color: #ddd;
      line-height: 1.6;
      text-align: center;
      text-shadow: 1px 1px 2px #666;
      p {
        margin: 0;
      }
    }
    .logo {
      text-align: center;
      margin-bottom: 2em;
    }
}

.screenshots-box {
  padding: 1.5em 0 1.5em 0;
  background: #eee;
  text-align: center;
  img {
    margin: 15px 0 15px 0;
    box-shadow: 0px 0px 10px -1px #000, 1px 1px 5px -1px #666;
  }
}

.spaced-box {
  margin-top: 1em;
  margin-bottom: 1em;
}

.news-item {
  display: table-row;
 .date {
    display: table-cell;
    padding: 0.5em 0.5em 0.5em 0;
    color: #bbb;
    font-weight: bold;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
 }
 .title {
    display: table-cell;
    border-bottom: 2px solid #eee;
 }
}

.btn-primary {
  background-color: #336699;
  border: 0;
}

.btn-primary:hover {
  background-color: #0063c7;
  border: 0;
  box-shadow: 0px 0px 3px #666;
}

h1, h2 {
  font-family: 'Open Sans Condensed', 'sans-serif';
  color: slategray;
  margin-bottom: 1em;
  margin-top: 1em;
}

h2 {
  font-size: 28px;
}

.breadcrumbs {
  margin-bottom: 20px;
  background-color: #f5f5f5;
}

ol.breadcrumb {
  margin-bottom: 0;
}

code {
  background-color: aliceblue;
  color: #333;
  padding: 1px 4px 0 4px;
  border-radius: 3px;
}

.blog_entries {
  img {
    max-width: 10%;
  }
}

table {
  border: 1px solid darkgrey;
  font-size: smaller;
  margin-bottom: 1em;
}

td {
  padding-left: 0.25em;
  padding-right: 0.25em;
}

th {
  padding-left: 0.25em;
  padding-right: 0.25em;
  border-bottom: 1px solid darkgrey;
}

.article {
  background: url("/images/blog/lightpaperfibers.png") repeat scroll 0 0 rgba(0, 0, 0, 0);
  border: 1px solid;
  border-color: lightgray;
  margin-top: 2em;
  padding: 1em 2em 1em 2em;
  border-radius: 15px;

  .date {
    font-family: Purisa, sans-serif;
    font-style: italic;
  }

  h1 {
    text-align: center;
    margin-bottom: 0.5em;
  }

  overflow: auto;

  @media (min-width: 670px) {
    h1 + p > img, h2 + p > img {
      float: right;
      padding: 0 1em 2em 2em;
      margin-top: -4em;
    }
  }

  @media (max-width: 669px) {
    h1 + p > img, h2 + p > img {
      float: left;
      padding: 1em 1.5em 0.5em 0em;
      max-width: 25%;
    }
  }

  h3 {
    display: inline-block;
  }
}

img {
  max-width: 100%;
  weight: auto;
}

pre.highlight {
  margin-top: 1em;
  margin-bottom: 1em;
  border: 1px solid lightgray;
  background-color: aliceblue;

  .c1 { color: seagreen; }

  &.lua:before { @include code-info('Lua') };
  &.moonscript:before { @include code-info('Moonscript') };
}

.footer {
  border-top: 1px solid #eee;
  margin-top: 40px;
  padding-top: 1em;
  margin-left: 1em;
  margin-right: 1em;
}

.footer-logo {
  float: left;
}

.footer-blurb {
  font-size: smaller;
  margin-left: 60px;
  min-height: 50px;
  vertical-align: text-bottom;
}

.footer-follow {
  float: right;
  font-size: smaller;
  vertical-align: text-bottom;
}

h3 {
  font-size: 18px;
  padding: 10px;
  padding-left: 0;
  margin: 1em 0 1em 0;
  vertical-align: middle;
  font-weight: bold;
}

.hdr-idx {
  display: inline-block;
  vertical-align: baseline;
  margin-right: 0.5em;
  color: #999;
  font-size: 14px;
}

h4 {
  margin-top: 1em;
  font-size: 16px;
  border-radius: $border_radius;
}

.arg-list {
  color: grey;
}

body.doc, body.versions {
  img {
    margin: 0.5em 0;
  }

  .toc {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: $border_radius;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    min-width: 50%;
    box-shadow: 0px 0px 3px 0px #666;

    .toc-title {
      background-color: #f5f5f5;
      color: darkslategray;
      font-weight: bold;
      font-size: 18px;
      padding: 0.5em;
      vertical-align: middle;
    }

    .toc-entries {
      padding: 0.5em;
    }

    .toc-group {
      margin: 0.5em;

      li {
        list-style: none;
        margin-left: 1em;
      }

      .toc-group-header {
        margin-bottom: 0.2em;
        display: block;
        font-weight: bold;
      }
    }
  }

  @media (min-width: 1900px) {
    .toc {
      margin-top: 7em;
      position: fixed;
      overflow-y: auto;
      top: 1%;
      left: 1em;
      min-width: 12%;
      max-height: 90%;
    }

  }

  @media (max-width: 1899px) {
    .toc {
      margin-bottom: 1em;

      .toc-title {
        display: none;
      }
    }
  }

  h1 {
    margin: 1em 0 0.5em 0;
  }

  /* header: properties / methods / functions */
  h2 {
    padding: 0.5em 0.5em 0.25em 0;
    border-bottom: 1px solid slategray;
    margin: 0.5em 0 0.5em 0;
  }

  /* badges */
  h2#properties ~ h3:before {
    @include property-badge();
  }

  h2#functions ~ h3:before {
    @include function-badge();
  }

  h2#methods ~ h3:before {
    @include method-badge();
  }

  h2#meta-methods ~ h3:before {
    @include meta-badge();
  }
}

body.doc_spec {
  .spec-group-2 {
    border: 1px solid green;
    padding: 1em;
    border-radius: $border-radius;
  }

  .spec-group-3 {
    border: 1px solid mediumseagreen;
    padding: 1em;
    border-radius: $border-radius;
  }

  .spec-group {
    margin-top: 1em;
  }

  h1:before {
    content: 'Spec';
    background-color: green;
    color: white;

    border-radius: 7px;
    margin: 0 0.5em 0.1em 0;
    padding: 0.1em 0.3em 0.1em 0.3em;
    border: 1px solid cadetblue;
    font-size: 16px;
    vertical-align: middle;
    display: inline-block;
  }

  h2 {
    margin: 0;
    padding: 0 0 0.5em 0;
  }

  h3 {
    background-color: #efefef;
    border: none;
    font-size: 18px;
    font-weight: bold;
    font-style: italic;
    margin: 0;
  }

  h4 {
    background-color: white;
    border: none;
    font-size: medium;
    color: green;
    font-weight: bold;
    font-style: italic;
  }
}
.howl-theme-selector {
  margin-top: -10px;
  float: right;
}
.howl-theme-selector > * {
  float: left;
}

.thumbnail {
  margin-bottom: 1em;
}

#screenshot-popup > .modal-dialog {
  width: 1150px;
  max-width: 100%;
}

iframe {
  @media (max-width: 669px) {
    max-width: 100%;
    max-height: 315px;
  }
}

.comments {
  margin-top: 3em;
}
